/* eslint-disable */
// @ts-ignore
import { request } from '@/utils/http/request';
import type { AxiosRequestConfig } from 'axios';
import type { RequestOptions as RequestOptionsType } from '/#/axios';
type RequestOptions = RequestOptionsType & AxiosRequestConfig;

import * as API from './types';

/**
 * 登录方法
 *
 * @method POST
 * @url /login
 * @param {object} body - 请求体数据
 * @param {object} options - 请求配置选项
 * @returns {Promise<API.AjaxResult>} 登录方法
 */
export async function submitApiLogin({
  body,
  options,
}: {
  body: API.LoginBody;
  options?: RequestOptions;
}) {
  return request<API.AjaxResult>('/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
